from optparse import OptionParser
import sys

parser = OptionParser()
parser.add_option("-f","--file",dest = "filename",
                  help = "write report to FILE", metavar="FILE")
parser.add_option("-q","--quiet",
                  action="store_false",dest="verbose",default=True,
                  help="don't print status message to stdout")

(options,args) = parser.parse_args()

print options.filename
print options.verbose
print args
print sys.argv


# here test with another one
parser = OptionParser()
parser.add_option("-n",type="int",dest="num")
(options,args) = parser.parse_args(["songyy"])
print options
print args
